<div class="container-xl">
  <!-- Page title -->
  <div class="page-header d-print-none">
    <div class="row align-items-center">
      <div class="col">
        <h2 class="page-title">
          站点订阅
        </h2>
      </div>
    </div>
  </div>
</div>
<!-- 业务页面代码 -->
<div class="page-body">
  <div class="container-xl">
    <div class="row row-cards">
        <div class="col-md-6">
          <div class="card">
            <div class="card-body">
              <h3 class="card-title">电影</h3>
              <p class="card-subtitle">订阅关键字：名称、年份或正则表达式</p>
              <div class="input-icon">
                <input id="movie_keys" type="text" data-role="tagsinput" value="{{ MovieKeys }}" class="form-control" placeholder="" style="display:none">
                <span class="input-icon-addon">
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-keyboard" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
                       <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                       <rect x="2" y="6" width="20" height="12" rx="2"></rect>
                       <line x1="6" y1="10" x2="6" y2="10"></line>
                       <line x1="10" y1="10" x2="10" y2="10"></line>
                       <line x1="14" y1="10" x2="14" y2="10"></line>
                       <line x1="18" y1="10" x2="18" y2="10"></line>
                       <line x1="6" y1="14" x2="6" y2="14.01"></line>
                       <line x1="18" y1="14" x2="18" y2="14.01"></line>
                       <line x1="10" y1="14" x2="14" y2="14"></line>
                    </svg>
                </span>
              </div>
            </div>
            <div class="card-footer">
              <div class="row align-items-center">
                <div class="col"></div>
                <div class="col-auto">
                  <a id="movie_keys_btn" href="javascript:save_movie_rss_keys('movie_keys')" class="btn btn-primary">
                    保存
                  </a>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="col-md-6">
          <div class="card">
            <div class="card-body">
              <h3 class="card-title">电视剧</h3>
              <p class="card-subtitle">订阅关键字：名称、年份或正则表达式</p>
              <div class="input-icon">
                <input id="tv_keys" type="text" data-role="tagsinput" value="{{ TvKeys }}" class="form-control" placeholder="" style="display:none">
                <span class="input-icon-addon">
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-keyboard" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
                       <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                       <rect x="2" y="6" width="20" height="12" rx="2"></rect>
                       <line x1="6" y1="10" x2="6" y2="10"></line>
                       <line x1="10" y1="10" x2="10" y2="10"></line>
                       <line x1="14" y1="10" x2="14" y2="10"></line>
                       <line x1="18" y1="10" x2="18" y2="10"></line>
                       <line x1="6" y1="14" x2="6" y2="14.01"></line>
                       <line x1="18" y1="14" x2="18" y2="14.01"></line>
                       <line x1="10" y1="14" x2="14" y2="14"></line>
                    </svg>
                </span>
              </div>
            </div>
            <div class="card-footer">
              <div class="row align-items-center">
                <div class="col"></div>
                <div class="col-auto">
                  <a id="tv_keys_btn" href="javascript:save_tv_rss_keys('tv_keys')" class="btn btn-primary">
                    保存
                  </a>
                </div>
              </div>
            </div>
          </div>
        </div>
    </div>
  </div>
</div>
<script src="../static/js/tagsinput.js"></script>
<script type="text/javascript">
  // 保存关键字设置
  function save_movie_rss_keys(id){
      var cmd = "moviekey";
      var param = {"movie_keys": $("#movie_keys").val()};
      $("#"+id+"_btn").text("正在保存...");
      $("#"+id+"_btn").attr("disabled", "true");
      ajax_post(cmd, param, function(ret){
          $("#"+id+"_btn").removeAttr("disabled");
          $("#"+id+"_btn").text("保存");
      });
  }
  // 保存关键字设置
  function save_tv_rss_keys(id){
      var cmd = "tvkey";
      var param = {"tv_keys": $("#tv_keys").val()};
      $("#"+id+"_btn").text("正在保存...");
      $("#"+id+"_btn").attr("disabled", "true");
      ajax_post(cmd, param, function(ret){
          $("#"+id+"_btn").removeAttr("disabled");
          $("#"+id+"_btn").text("保存");
      });

  }
</script>